
public class PayrollSystemTest {


	public static void main(String[] args) 
	{

		SalariedEmployee salariedEmployee = new SalariedEmployee("John", "Smith", "111-11-111", 800.0);
		HourlyEmployee hourlyEmployee = new HourlyEmployee("Karen", "Price", "222-22-222", 16.75, 40.0);
		CommissionEmployee commissionEmployee = new CommissionEmployee("Sue", "Jones", "333-33-3333", 10000.0, 0.06);
		BasePlusCommissionEmployee basePlusCommissionEmployee = new BasePlusCommissionEmployee("Bob", "Lewis", "444-44-4444", 5000.0, 0.04, 300);
		
		System.out.println("---------------------");
		System.out.println(salariedEmployee.toString());
		System.out.println("---------------------");
		System.out.println(hourlyEmployee.toString());
		System.out.println("---------------------");
		System.out.println(commissionEmployee.toString());
		System.out.println("---------------------");
		System.out.println(basePlusCommissionEmployee.toString());
		System.out.println("---------------------");
		
		Employee[] employees = new Employee[4];
		
		employees[0] = salariedEmployee;
		employees[1] = hourlyEmployee;
		employees[2] = commissionEmployee;
		employees[3] = basePlusCommissionEmployee;
		
		System.out.println("---------------------");
		System.out.println("Employees processed Polymorphically: ");
		
		for(Employee currentEmployee : employees)
		{
			System.out.println("---------------------");
			
			
			if(currentEmployee instanceof BasePlusCommissionEmployee)
			{
				BasePlusCommissionEmployee employee = (BasePlusCommissionEmployee)currentEmployee;
				employee.setbaseSalary(1.1*employee.getbaseSalary());
				System.out.println("New base salary with 10% increase");
			}
			
			System.out.println(currentEmployee);
		}
	
		System.out.println("---------------------");
		for(int i=0 ; i<employees.length; i++)
		{
			System.out.println(employees[i].getClass().getName());
		}
	
	
	}

}
